//import createjs from "../../../createjs";
import BaseView from "../../components/BaseView";
import cjs=createjs
import ProgressBar from "../../components/ProgressBar";
export default class PreloadView extends BaseView{
    private _bg=new cjs.Shape()
    private _progressbar=new ProgressBar()
    constructor(w?:number,h?:number){
        super(w,h)
        this.addChild(this._bg)
        this.addChild(this._progressbar)
        this.reflush()
    }
    setProgress(value:number):void{
        this._progressbar.progress=value
    }
    reflush(): void {
        this._progressbar.setSize(this.width-160,20)
        this._progressbar.setTransform(80,this.height/2)

        const g=this._bg.graphics
        g.clear()
        g.beginFill('black')
        g.drawRect(0,0,this.width,this.height)
        g.endFill()
    }
}